<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@page import="cn.edu.dlut.ssdut.foodCredit2012.model.UploadImage"%>
<%@page import="cn.edu.dlut.ssdut.foodCredit2012.service.UploadImageService"%>
<%@page import="java.util.List"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%
UploadImageService uis=new UploadImageService();
List<UploadImage> list=uis.loadFiveImage();

%>
<style type="text/css">
	td,th {
	border-right: 1px solid #C1DAD7;
	border-bottom: 1px solid #C1DAD7;
	background: #fff;
	font-size: 11px;
	padding: 6px 6px 6px 12px;
	color: #4f6b72;
}
	</style>
</head>


<body>

<form id="addImage" method="post" action="addImage" enctype="multipart/form-data">
<table>
	<tr>
		<th>title:</th>
		<td><input type="text" id="txTitle" name=title /></td>
	</tr>
	<tr>
		<th>link:</th>
		<td><input type="text" id="txLink" name="link" /></td>
	</tr>
	<tr>
		<th>image:</th>
		<td><input type="file" name="img" id="img"/>
		</td>
	</tr>
	<tr>
		<td colspan="2" style="text-align:center"><input id="btAdd" type="submit" value="Add" /></td>
	</tr>
</table>
</form> 
<table>
	<tr>
		<th>order</th>
		<th>img</th>
		<th>title</th>
		<th>link</th>
		<th>option</th>
	</tr>
	<%for(int i=0;i<list.size();i++){
		UploadImage image=list.get(i);
		%>
		<tr>
		<td><%=(i+1) %></td>
		<td><img src="<%=image.getSavePath()%>" /></td>
		<td><%=image.getName()%></td>
		<td><%=image.getLink() %></td>
		<td><a href="delImage?cid=<%=image.getId()%>">delete</a></td>
	</tr>
	<% }%>
	
</table>
</body>
</html>